#include "PlatformInterface.h"

#ifdef WIN32
#include "WindowsPlatform.h"
#endif


#ifdef LINUX
#include "LinuxPlatform.h"
#endif


IPlatformInterface *IPlatformInterface::GetPlatformInterface()
{

#ifdef WIN32
    static CWindowsPlatform WindowsPlatform;
    return &WindowsPlatform;
#endif

#ifdef LINUX
    static CLinuxPlatform LinuxPlatform;
    return &LinuxPlatform;
#endif


}

CString WH::GetPlatformName(EPlatform Platform)
{
    switch (Platform)
    {
    case EPlatform::Unknown:
        return U"Unknown";
    case EPlatform::Windows:
        return U"Windows";
    case EPlatform::Linux:
        return U"Linux";
    default:
        assert(false&& "unimplemented platform name");
        return U"Unknown";
    }
}

CString WH::GetArchitectureName(EArchitecture Architecture)
{
    switch (Architecture)
    {
    case EArchitecture::Unknown:
        return U"Unknown";
    case EArchitecture::x64:
        return U"x64";
    case EArchitecture::AArch64:
        return U"AArch64";
    default:
        assert(false&& "unimplemented architecture name");
        return U"Unknown";
    }
}

TVector<CString> IPlatformInterface::ConvertArgsToUnicode(int argc, char *argv[]) const
{
    TVector<CString> Result;
    Result.Reserve(argc);
    for (int i = 0; i < argc; ++i)
    {
        Result.Add(SystemStringToUnicode(argv[i]));
    }
    return Result;
}
